package com.flame.shapeville.component.task1.shape3D;

import javafx.scene.paint.Color;
import javafx.scene.paint.Material;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.Shape;
import javafx.scene.shape.Shape3D;
import lombok.Getter;

/**
 * Abstract base class for all 3D shapes used in Task 1.
 * Provides common structure and styling functionality for rendering basic 3D geometric shapes.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-12
 */
public abstract class JfShape3D {
    /**
     * The size (width/height) of the drawing area for this shape.
     */
    double size;

    /**
     * The JavaFX Shape3D object representing the visual geometry of this shape.
     */
    @Getter
    Shape3D shape;

    /**
     * Constructs a new 3D shape with the specified size.
     *
     * @param size the bounding box size for this shape
     */
    JfShape3D(double size) {
        this.size = size;
    }

    /**
     * Initializes the shape with a base material color.
     *
     * @param surfaceColor the color to apply as the surface material
     */
    void initBaseParams(Color surfaceColor) {
        shape.setMaterial(new PhongMaterial(surfaceColor));
    }
}
